package com.scau.os.controller;

import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;

/**
 * Sample Skeleton for 'main-view.fxml' Controller Class
 */

import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;

public class MainViewController implements Initializable{

    @FXML
    private Button diviceManager;

    @FXML
    private Button courseSchedule;

    @FXML
    private Button memoryManager;

    @FXML
    private Button filesManager;

    @Override
    public void initialize(URL location, ResourceBundle resources) {
        courseSchedule.setOnMouseClicked(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
                Stage stage=new Stage();
                FXMLLoader fxmlLoader = new FXMLLoader(MainViewController.class.getResource("course-view.fxml"));
                try {
                    Scene scene = new Scene(fxmlLoader.load(), 900, 600);
                    stage.setScene(scene);
                    stage.show();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }


            }
        });
    }
}


